<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/4/7 0007
 * Time: 12:15
 */
class Round {
    static $lastIndex = 0;

    public static function select(array  $slaves)
    {
        $currentIndex = self::$lastIndex;
        $slave = $slaves[$currentIndex];
        if($currentIndex + 1 > count($slaves)-1){
            self::$lastIndex = 0;
        }else{
            self::$lastIndex ++ ;
        }
        return $slave;
    }
}